

<%@ page import="org.icress.fusion.b2b.Department" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
    <g:set var="entityName" value="${message(code: 'b2b.department.label', default: 'Department')}" />
    <title><g:message code="default.edit.label" args="[entityName]" /></title>
</head>
<body>
    <div class="nav">
        <shiro:hasPermission permission="department:list">
        <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </shiro:hasPermission>
        <shiro:hasPermission permission="department:create">
        <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </shiro:hasPermission>
    </div>
    <div class="body">
        <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
        <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
        </g:if>
        <g:hasErrors bean="${departmentInstance}">
        <div class="errors">
            <g:renderErrors bean="${departmentInstance}" as="list" />
        </div>
        </g:hasErrors>
        <g:form method="post" >
            <g:hiddenField name="id" value="${departmentInstance?.id}" />
            <g:hiddenField name="version" value="${departmentInstance?.version}" />
            <div class="dialog">
                <table>
                    <tbody>
                    
                        <tr class="prop">
                            <td  class="name">
                              <label for="serialNumber"><g:message code="department.serialNumber.label" default="Department Number" /></label>
                            </td>
                            <td  class="value ${hasErrors(bean: departmentInstance, field: 'serialNumber', 'errors')}">
                                <g:textField name="serialNumber" maxlength="6" value="${departmentInstance?.serialNumber}" />
                            </td>
                        </tr>
                    
                        <tr class="prop">
                            <td  class="name">
                              <label for="name"><g:message code="department.name.label" default="Name" /></label>
                            </td>
                            <td  class="value ${hasErrors(bean: departmentInstance, field: 'name', 'errors')}">
                                <g:textField name="name" maxlength="20" value="${departmentInstance?.name}" />
                            </td>
                        </tr>
                    
                        <tr class="prop">
                            <td  class="name">
                              <label for="desc"><g:message code="department.desc.label" default="Desc" /></label>
                            </td>
                            <td  class="value ${hasErrors(bean: departmentInstance, field: 'desc', 'errors')}">
                                <g:textArea name="desc" cols="40" rows="5" value="${departmentInstance?.desc}" />
                            </td>
                        </tr>
                    
                        <tr class="prop">
                            <td  class="name">
                              <label for="isActive"><g:message code="department.isActive.label" default="Is Active" /></label>
                            </td>
                            <td  class="value ${hasErrors(bean: departmentInstance, field: 'isActive', 'errors')}">
                                <g:checkBox name="isActive" value="${departmentInstance?.isActive}" />
                            </td>
                        </tr>
                    
                    </tbody>
                </table>
            </div>
            <div class="buttons">
            	<shiro:hasPermission permission="department:update">
                <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                </shiro:hasPermission>
                <shiro:hasPermission permission="department:delete">
                <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </shiro:hasPermission>
            </div>
        </g:form>
    </div>
</body>
</html>
